package com.example.tellwin.mine.presenter;

import com.example.tellwin.api.TwjfApi;
import com.example.tellwin.base.RxPresenter;
import com.example.tellwin.base.SimpleCallback;
import com.example.tellwin.home.bean.ContentBean;
import com.example.tellwin.mine.contract.ApplyResultContract;

import javax.inject.Inject;

/**
 * @author : LinZePeng
 * @date : 2020/12/1
 * @Describe ：
 **/
public class ApplyResultPresenter extends RxPresenter<ApplyResultContract.View> implements ApplyResultContract.Presenter<ApplyResultContract.View> {

    private TwjfApi mApi;

    @Inject
    public ApplyResultPresenter(TwjfApi mApi) {
        this.mApi = mApi;
    }

    @Override
    public void getApplyFailReason() {
        mApi.applyDetail(new SimpleCallback<ContentBean>(mView) {
            @Override
            public void onSuccess(ContentBean contentBean) {
                if(contentBean.getResaon()!=null){
                    mView.applyFailReason(contentBean.getResaon());
                }
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }
}
